package com.ruoyi.system.service.aid.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.aid.AidCarrierMapper;
import com.ruoyi.system.domain.aid.AidCarrier;
import com.ruoyi.system.service.aid.IAidCarrierService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;

/**
 * 承运商Service业务层处理
 */
@Service
public class AidCarrierServiceImpl implements IAidCarrierService {
    @Autowired
    private AidCarrierMapper carrierMapper;

    @Override
    public List<AidCarrier> selectCarrierList(AidCarrier carrier) {
        return carrierMapper.selectCarrierList(carrier);
    }

    @Override
    public AidCarrier selectCarrierById(Long carrierId) {
        return carrierMapper.selectCarrierById(carrierId);
    }

    @Override
    public int insertCarrier(AidCarrier carrier) {
        carrier.setCreateTime(DateUtils.getNowDate());
        carrier.setCreateBy(SecurityUtils.getUsername());
        return carrierMapper.insertCarrier(carrier);
    }

    @Override
    public int updateCarrier(AidCarrier carrier) {
        carrier.setUpdateTime(DateUtils.getNowDate());
        carrier.setUpdateBy(SecurityUtils.getUsername());
        return carrierMapper.updateCarrier(carrier);
    }

    @Override
    public int deleteCarrierByIds(Long[] carrierIds) {
        return carrierMapper.deleteCarrierByIds(carrierIds);
    }

    @Override
    public int deleteCarrierById(Long carrierId) {
        return carrierMapper.deleteCarrierById(carrierId);
    }
} 